#------------------------------------------------------------------------------
# Figure 5. Political Homophily by Relationship Type
# see PI_models_dyad_logit.do
#==============================================================================

coef1 <- NULL 
coef1 <- rbind(coef1,c(.6402374 , .6111143,.6693605))
coef1 <- rbind(coef1,c(.5134893 , .4858082,.5411705))
coef1 <- rbind(coef1,c(.5676587 , .5386071,.5967103))
coef1 <- rbind(coef1,c(.5354599 , .5139176,.5570023))
coef1 <- rbind(coef1,c(.6081996 , .5276172,.6887819))

coef2 <- NULL 
coef2 <- rbind(coef2,c( .713982 , .6919155,.7360485))
coef2 <- rbind(coef2,c(.5501609 , .5221901,.5781318))
coef2 <- rbind(coef2,c(.6474662 , .6161702,.6787622))
coef2 <- rbind(coef2,c(.6224467 , .6007856,.6441077))
coef2 <- rbind(coef2,c(.7608938 , .7192367, .802551))

tab<- NULL 
tab <- rbind(coef1[,1],coef2[,1])

pdf(here('results','figures',"homophily_bytype.pdf"),paper="special",width=8,height=5)
barplot(tab*100,beside=TRUE,col=c("white","gray"),ylim=c(50,90),xpd=FALSE,
	names.arg=c("GSS 1987","CNES 1992","ANES 2000", "ANES 2008","TESS 2016"),
	ylab="Political Homophily",
	legend=c("non-kin","kin"),args.legend=list(bty="n"))
dev.off()


